package com.duanyf.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.duanyf.usercenter.model.domain.User;

import javax.servlet.http.HttpServletRequest;

/**
* @author duanyf
* @description 针对表【user】的数据库操作Service
* @createDate 2024-05-28 22:34:13
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param checkPassword 校验密码
     * @return 新用户id
     */
    long userRegister(String userAccount,String userPassword,String checkPassword);

    /**
     * 用户登录
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param request 用于向请求的session设置和读取值
     * @return 脱敏的用户信息
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    User getSafeUser(User originUser);
}
